<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }

        div{
            width:100px;
            height:100px;
            background-color: skyblue;
            color:#fff;
            font-size: 20px;
        }

        div.active{
            width:200px;
            height:200px;
            background-color: orange;
            color:#fff;
            font-size: 30px;
        }
    </style>
</head>
<body>
    <button>点击切换</button>
    <div>
        hello world
    </div>
    <script>
        var btn = document.querySelector('button');
        var divele = document.querySelector('div');

        btn.onclick = function(){
            divele.classList.toggle('active');
            // toggle 如果存在active  给你删除active 
            // 不存在  增加active
        }

    </script>
</body>
</html>